package com.jsu.collegestudentadmissionsystem.controller;

import com.jsu.collegestudentadmissionsystem.pojo.vo.CollegeInformation;
import com.jsu.collegestudentadmissionsystem.service.AdministratorService;
import com.jsu.collegestudentadmissionsystem.utils.AcquireStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import java.util.List;
import java.util.Scanner;


@Controller
public class AdministratorController {
    @Autowired
    AdministratorService administratorService;

    Integer majorId;
    Scanner sc1 = new Scanner(System.in);

    //查询
    private void searchInfo(){ administratorService.queryMajorInformation(); }

    //增
    private void insertInfo(){
        System.out.println("请依次输入：专业code、专业name");

        String str = sc1.nextLine();
        String [] mid = str.split(" ");
        administratorService.insertMajorInformation(this.majorId,mid[0],mid[1]);
    }

    //删

    //改

    //查


    public  void dispatch(Integer operation ){
        switch (operation){

            case 1 :
                insertStudentInformation();break;
            case 2 :
                break;
            case 3 :
                break;
            case 4 :
                searchStudentInformation(); break;
            case 5 :
                insertCollegeInformation(); break;
            case 6:
                break;
            case 7 :
                break;
            case 8 :
                searchCollegeInformation(); break;
            case 9 :
                insertScoreInformation(); break;
            case 10 :
                updateStatus(); break;
            default:
                break;
        }
    }

    private void insertScoreInformation() {
        administratorService.insertScoreInformation();
    }


    private void searchCollegeInformation() {
        administratorService.searchCollegeInformation();
    }

    private void insertStudentInformation() {
        administratorService.insertStudentInformation();
    }

    private void searchStudentInformation() {
        administratorService.searchStudentInformation();
    }

    private void insertCollegeInformation() {
        administratorService.insertCollegeInformation();
    }

    private void updateStatus() {
            administratorService.updateStatus();
            }

    }
